n, m = map(int, input().split())
sticks = list(map(int, input().split()))
right = int(1e10)
left = 1
s = sum(sticks)


def f(length):  # 把木棒切到<=length长度需要多少次
    cnt = 0
    for stick in sticks:
        if stick > length:
            cnt += stick // length
    return cnt <= m


while left <= right:
    mid = (left + right) >> 1
    if f(mid):
        right = mid - 1
    else:
        left = mid + 1
print(right + 1)
